package com.lw.entity;

import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * Created by IntelliJ IDEA
 *
 * @Author L1W31
 * @Date 2021/8/3 20:33
 * @Version 1.0
 * @Description 秒杀成功明细表的实体类
 */

public class SuccessKilled {

    // 秒杀成功明细表对应的字段
    private long secKillId;
    private long userPhone;
    private short state;
    private Date createTime;

    // 多对一关联，一个SecKill对应多个SuccessKilled，
    // 因为一件商品在库存中有很多数量，对应的购买明细也有很多
    private SecKill secKill;

    // get和set方法
    public long getSecKillId() {
        return secKillId;
    }

    public void setSecKillId(long secKillId) {
        this.secKillId = secKillId;
    }

    public long getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(long userPhone) {
        this.userPhone = userPhone;
    }

    public short getState() {
        return state;
    }

    public void setState(short state) {
        this.state = state;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public SecKill getSecKill() {
        return secKill;
    }

    public void setSecKill(SecKill secKill) {
        this.secKill = secKill;
    }

    // 重写的toString方法
    @Override
    public String toString() {
        return "SuccessKilled{" +
                "secKillId=" + secKillId +
                ", userPhone=" + userPhone +
                ", state=" + state +
                ", createTime=" + createTime +
                '}';
    }
}
